Repository navigation
Finished runs never leave their pull request a draft silently - #501
Merged
Merged
Conversation
One decision (passes::ready::decide) now settles every pull request a finished run leaves, on every path: the run's own completion, the mark-ready message, an end-to-end proof that held, and a new sweep. - With the repository's CI green and CoderHelm's review approving, CoderHelm's own sandbox failures and checklist items no longer hold the draft: the pull request is marked ready with them under Open items. - What a person must decide still holds it: security items, planned work not done, a failed check, open own-review findings, a stacked change, a person's draft, a loosened test, failing redirects. - A hold is logged at warn, written at the top of the description, and recorded on the run (draft_hold); a hold a person must act on makes the finished run needs_input with what to do. - A mark-ready GitHub refuses is sent again after its reset, at most MAX_WAITS times; the last refusal is recorded on the run. - The sweep decides again for finished runs left a draft with no reason. - The run API returns draft_hold; incident case s_silent_draft.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A finished run's pull request never stays a draft without a reason a person can act on, and marking it ready can't be lost.
What happened: a new-feature run finished with the repository's CI green and CoderHelm's review approving, and its pull request stayed a draft. Four of CoderHelm's own sandbox checks had failed on the head,
feature::ready_holdreturned on them, andmark_pr_readyreturned without a word. The run page said completed, and no "marked ready" or "stays a draft" line was logged. The same day, mark-ready messages that hit GitHub's rate limit were logged as "Mark PR ready failed" and dropped, so five more pull requests were never marked ready.Now there is one decision,
passes::ready::decide, and every path goes throughready::settle: the run's own completion, the mark-ready message, an end-to-end proof that held, and a new sweep. It returnsReady { open },Held { reasons }(each reason says what holds it and what to do),Wait { why, until }, orClosed.Which holds stay, and which became open items
Default to progress: a hold must be something a person has to decide, or a named correctness, security or data-loss problem.
Kept as holds (the PR stays a draft, and the run is
needs_input):Waits (no person needed; CoderHelm decides again by itself, and the run page says what it waits for):
Became open items (the PR is marked ready and they are listed under Open items):
sandbox_failed), once the repository's CI is green on the head and CoderHelm's review approved it.Changes
services/worker/src/passes/ready.rs(new):decide(pure),settle,on_message, the run-record writes, the retry, andsweep. Each choice is explained in comments next to the code.completeness::Section::DraftStatus), and removed once the PR is ready.draft_hold(common::draft_hold).needs_input, with aWaitingOnnaming the pull request and the reasons. The status write goes throughNeedsInput::needs_input, as the run_wait rule requires, and therun.needs_inputevent is sent.stop_judge::cannot_proceed, kindhandoff, stepdraft_hold). No model is asked, becausedecidehas already kept only what a person must act on. The source rule that everyneeds_inputwrite holds a judged decision still passes.end_runchecks the run again right after it writescompleted(ready::after_completion).MarkReadyMessagegainsrun_id,attempt,not_beforeandsquash_keep_first, all serde-defaulted, so old messages still parse.clients::github::outside_wait, from Runs wait out GitHub's limits instead of failing; refused writes are never "no file" #499), otherwise it backs off. A wait longer than one SQS delay goes in hops.common::github_wait::MAX_WAITStimes. The last refusal is recorded on the run as afailedhold and written in the description.draft_settled, and makes at most 40 decisions per sweep.feature::ready_holdnow returns its items as structured data (FeatureHold) instead of a joined string, and a read failure no longer holds the draft. The Open items wording no longer says these items keep the draft.test_fix::HoldgainsRefused(a loosened test or an unjustified wait: a person decides) andGaveUp(out of rechecks), next toWait.proof::with_marked_itemsis the general version ofwith_security_items, which now uses it.draft_hold(kind,summary,reasons[{what, todo}],pr_number,since).docs/api/openapi.jsonis regenerated.s_silent_draftand its row indocs/incidents.md. Incidentknow checks the shared decision instead of the old mark-ready function inmain.rs.Dashboard (not changed here): the run page should show
draft_hold.summarywheneverdraft_holdis set, for example "Finished, but pull request #21 stays a draft: ...". It should list each reason with itstodo. Aneeds_inputrun with adraft_holdshould read as "Finished, PR held" rather than "Needs input".Verification
cargo fmt --checkcargo clippy -p common -p gateway -p worker --all-targets -- -D warningscargo test -p common -p gateway -p worker: common 1505 passed (plus 2 inno_hosted_urls), gateway 748 passed, worker 1370 passed, 0 failedready::tests: each hold and open-item choice, the description section written once and removed once ready, open items not listed twice, CoderHelm's own checks left out of CI, retry backoff and the rate-limit wait, message compatibility, and the sweep's choice per run.common::draft_hold::tests.incidents::s_silent_draft: the incident replayed, every path going through the one decision with no silent return, the retry and the final failure, and the sweep healing a silent draft.